$(function() {
    "use strict";

    //Make the dashboard widgets sortable Using jquery UI
    $(".connectedSortable").sortable({
        placeholder: "sort-highlight",
        connectWith: ".connectedSortable",
        handle: ".box-header, .nav-tabs",
        forcePlaceholderSize: true,
        zIndex: 999999
    }).disableSelection();
    $(".connectedSortable .box-header, .connectedSortable .nav-tabs-custom").css("cursor", "move");


    // 关闭窗口提示
    var preventUnloadPrompt = false;
    var messageBeforeUnload = "您确定关闭此页面?";

    $(document).on("click",'a',function(){
        preventUnloadPrompt = true;
    });
    $(document).on("submit",'form',function(){
        preventUnloadPrompt = true;
    });
    $(window).bind("beforeunload", function(e) {
        if (preventUnloadPrompt) {
            return;
        } else {
            return messageBeforeUnload;
        }
    });
});